package com.trs.publish.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.trs.publish.domain.PowerCatalog;
import com.trs.publish.repository.PowerCatalogRepository;

/**
 * @author jia.haihong
 */
@Service
@Transactional
public class PowerCatalogService{

	@Autowired
    private PowerCatalogRepository powerCatalogRepository;

	public List<PowerCatalog> getList(PowerCatalog powerCatalog) {
		return powerCatalogRepository.findByPowerCatalog(powerCatalog);
	}

	public void deletePowerCatalog(long id) {
		powerCatalogRepository.deleteById(id);
	}

	public PowerCatalog findById(long id) {
		return powerCatalogRepository.findById(id);
	}

	public List<PowerCatalog> queryByPid(long pid) {
		return powerCatalogRepository.findByPid(pid);
	}

	public void save(PowerCatalog powerCatalog) {
		powerCatalogRepository.save(powerCatalog);
	}

	public void update(PowerCatalog powerCatalog) {
		powerCatalogRepository.update(powerCatalog);
	}

	
}
